/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-06-26     chenlei       the first version
 */
#ifndef APPLICATIONS_INC_HEAD_H_
#define APPLICATIONS_INC_HEAD_H_
//bsp
#include <board.h>
#include <rtdevice.h>
#include <drv_common.h>
#include "vl53l0x.h"


//app
#include "motor_app.h"
#include "uart_app.h"
#include "bsp_buzzer.h"

extern rt_device_t serial_3;
extern rt_mutex_t vl53l0_mutex;
extern rt_mutex_t car_num_mutex;

//extern uint8_t g_license_plate[];      //k230识别车牌号数据
//extern uint8_t g_license_eg800k[];     //eg800k接收车牌号数据
typedef enum
{
    STATE_FALL,             //降下（稳定状态）
    STATE_RASI,             //升起（稳定状态）
    STATE_FALLING,          // 降下中
    STATE_RAISING,          // 升起中
    STATE_SHOULD_RAISE,     //应该升起
    STATE_SHOULD_FALL       //应该降下
}CAR_LOCK_STATE_T;


void vl53l0_thread(void *parameter);
void car_lock_thread(void *parameter);
void set_car_lock_state(CAR_LOCK_STATE_T new_state);
CAR_LOCK_STATE_T get_car_lock_state(void);
uint8_t debounce_position_pin(void);

#endif /* APPLICATIONS_INC_HEAD_H_ */
